package com.kurumi.autoprint.util;

public class WaterMarkPosition {

	//position 参数： 在进行水印进行相对位置移动时选择 
	public static final int LEFT_CENTER = 0; //左侧 中部
	public static final int LEFT_TOP = 1; //左侧 顶部	
	public static final int TOP_CENTER = 2; //顶部 中间
	public static final int RIGHT_TOP = 3; //右侧 顶部
	public static final int RIGHT_CENTER = 4;//右侧 中部
	public static final int RIGHT_BUTTOM = 5;//右侧 底部
	public static final int BUTTOM_CENTER = 6;//底部 中间
	public static final int LEFT_BUTTOM  = 7;//左侧 底部
	
	private int position;
	
	private int angle;
	
	private float x;
	
	private float y;

	private int fontSize;
	
	private String text;
	
	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public int getFontSize() {
		return fontSize;
	}

	public void setFontSize(int fontSize) {
		this.fontSize = fontSize;
	}

	public float getX() {
		return x;
	}
	
	public float getY() {
		return y;
	}
	
	
	public int getPosition() {
		return position;
	}




	public void setPosition(int position) {
		this.position = position;
	}




	public void setX(float x) {
		this.x = x;
	}




	public void setY(float y) {
		this.y = y;
	}


	public int getAngle() {
		return angle;
	}


	public void setAngle(int angle) {
		this.angle = angle;
	}


	public static WaterMarkPosition getPdfWaterMarkPosition(int position, float xOffset, float yOffset, float width, float height,float markWidth, float markHeight){
		WaterMarkPosition markPosition = new WaterMarkPosition();
		switch(position){
			case LEFT_CENTER:{ 
				markPosition.x = xOffset; 
				markPosition.y = (height - markHeight)/2 + yOffset;
				break;
				}
			case LEFT_TOP:{
				markPosition.x = xOffset; 
				markPosition.y = height - markHeight + yOffset;
				break;
				}
			case TOP_CENTER:{
				markPosition.x = (width - markWidth)/2 + xOffset; 
				markPosition.y = height - markHeight + yOffset;
				break;
				}
			case RIGHT_TOP:{
				markPosition.x = (width - markWidth) + xOffset;
				markPosition.y = height - markHeight + yOffset;
				break;
				}
			case RIGHT_CENTER:{
				markPosition.x = (width - markWidth) + xOffset; 
				markPosition.y = (height - markHeight)/2 + yOffset;
				break;
				}
			case RIGHT_BUTTOM:{
				markPosition.x = width - markWidth + xOffset; 
				markPosition.y = markHeight + yOffset;
				break;
				}
			case BUTTOM_CENTER:{
				markPosition.x =  (width - markWidth)/2 + xOffset;
				markPosition.y = markHeight + yOffset;
				break;
				}
			
			case LEFT_BUTTOM:{ 
				markPosition.x = xOffset; 
				markPosition.y = markHeight + yOffset;
				break;
				}
			default:{
				return null;
				}
		}
		return markPosition;
	}
}
